<html>
<head>
    <title>定时任务作业记录</title>
    <script src="/static/statics/libs/jquery-1.7.2.js"></script>
    <link rel="stylesheet" href="/static/statics/css/font-awesome.min.css">
    <link rel="stylesheet" href="/static/statics/plugins/layui/css/layui.css" media="all">
    <script src="/static/statics/plugins/layer/layer.js"></script>
    <script src="/static/statics/plugins/layui/layui.js"></script>
    <script src="/static/common/js/pageGrid1.js"></script>
    <script src="/static/common/js/tplTool.js"></script>
    <script src="/static/common/js/editGrid.js"></script>
    <script src="/static/common/js/whole/cyLayer.js"></script>
    <script src="/static/common/js/whole/common.js"></script>
    <script src="/static/common/js/whole/utils.js"></script>
    <script src="/static/common/js/whole/monitor.js"></script>
    <link rel="stylesheet" href="/static/common/css/cyStyle.css">
    <link rel="stylesheet" href="/static/common/css/cyType.css">
</head>
<body>
<form class="layui-form" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">作业名称:</label>
        <div class="layui-input-inline">
            <input type="text" name="taskName" id="taskName" class="layui-input"/>
        </div>
        <label class="layui-form-label">作业状态:</label>
        <div class="layui-input-inline">
            <select name="taskState" lay-filter="taskState">
                <option value=""></option>
                <option value="执行成功">执行成功</option>
                <option value="执行失败">执行失败</option>
            </select>
        </div>
        <div class="layui-input-normal">
            <button class="layui-btn search-btn" table-id="pageGrid" lay-submit="" lay-filter="search">
                <i class="fa fa-search"> </i>查询
            </button>
            <button type="reset" class="layui-btn layui-btn-primary"><i class="fa fa-refresh">&nbsp;</i>重置</button>
        </div>
    </div>
</form>
<div class="layui-form nowrap">
    <table class="layui-table" id="pageGrid" cyType="pageGrid" lay-filter="pageGrid" table-id="pageGrid"
           cyProps="url:'/timingManager/jobLogList',checkbox:'false',pageColor:'#2991d9'">
        <thead>
        <tr>
            <th width="5%" param="{name:'id',isPrimary:'true',hide:'false'}">ID</th>
            <th width="10%" param="{name:'taskId'}">作业任务ID</th>
            <th width="10%" param="{name:'taskName'}">作业名称</th>
            <th width="10%" param="{name:'taskState'}">作业状态</th>
            <th width="5%" param="{name:'co1'}">执行时长(Ms)</th>
            <th width="5%" param="{name:'executeDate'}">作业时间</th>
            <th width="10%" param="{operate:'true',buttons:'Render.view,Render.errorLog'}">操作</th>
        </tr>
        </thead>
    </table>
</div>

<script>
    layui.use(['form', 'table'], function () {
        var form = layui.form;
    });
    var Render = {
        view: function (rowdata) {
            var str = rowdata.taskContent;
            if (str != null || str == "") {
                str = str.replace(/\'/g, "’");
                str = str.replace(/\"/g, "”");
                str = str.replace(/</g, "《").replace(/>/g, "》");
                str = str.replace(/\r/g, "&nbsp;");
                str = str.replace(/\n/g, "<br />");
                str = str.trim();
            }
            var btn = ' <button   onclick="openViewText(\'' + "查看作业SQL" + '\',\'' + str + '\')" class="layui-btn layui-btn-sm  layui-btn-normal ">SQL</button>';
            return btn;
        },
        errorLog: function (rowdata) {
            var str = rowdata.taskError;
            if (str != null || str == "") {
                str = str.replace(/\'/g, "’");
                str = str.replace(/\"/g, "”");
                str = str.replace(/</g, "《").replace(/>/g, "》");
                str = str.replace(/\r/g, "&nbsp;");
                str = str.replace(/\n/g, "<br />");
                str = str.trim();
            }
            var btn = ' <button  onclick="openViewText(\'' + "查看日志" + '\',\'' + str + '\')" class="layui-btn layui-btn-sm layui-btn-danger ">日志</button>';
            return btn;
        }
    };
</script>
</body>
</html>